import { defineAsyncComponent } from 'vue'
import Loading from "@/components/Loading.vue"

export const loadable = (asyncFun: any): any => {
    const component = defineAsyncComponent({
        loader: () => asyncFun(),
        delay: 200,
        timeout: 3000,
        loadingComponent: Loading,
        errorComponent: Loading
    })
    return component
}
